package com.heima;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/*@EnableDiscoveryClient   //开启eureka客户端发现功能
@SpringBootApplication
@EnableCircuitBreaker    //开启断路器功能*/

@SpringCloudApplication   //上面三个的组合注解
@EnableFeignClients      //开启feign功能
public class ConsumerApplication {
    public static void main(String[] args)
    {
        SpringApplication.run(ConsumerApplication.class, args);
    }

    @Bean
    @LoadBalanced   //负载均衡
    public RestTemplate restTemplate()
    {

        return new RestTemplate();
    }

}



